package com.xxz.course;

import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class ScoreActivity extends AppCompatActivity {

    TextView out1,out2;
    Button b1, b2, b3,b4,b5,b6,b7;
    int sa = 0;
    int sb = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_score);
        out1 = findViewById(R.id.txt1);
        out2 = findViewById(R.id.txt2);
    }
    public void myclick(View v){
        if(v.getId()==R.id.b1) sa=sa+3;
        else if(v.getId()==R.id.b2) sb=sb+3;
        else if(v.getId()==R.id.b3) sa=sa+2;
        else if(v.getId()==R.id.b4) sb=sb+2;
        else if(v.getId()==R.id.b5) sa=sa+1;
        else if(v.getId()==R.id.b6) sb=sb+1;
        else
        {
            sa=0;
            sb=0;
        }
        out1.setText(""+sa);
        out2.setText(""+sb);

    }

}